package cn.wolfcode.trip.base.mapper;

import cn.wolfcode.trip.base.domain.User;
import cn.wolfcode.trip.base.query.QueryObject;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;

public interface UserMapper {

    int insert(User record);

    User selectByPrimaryKey(Long id);

    List<User> selectAll();

    int updateByPrimaryKey(User record);

    User selectByEmailAndPassword(@Param("email") String email, @Param("password") String password);

    List<User> selectForList(QueryObject qo);

    void addGrade(@Param("id") Long uId, @Param("grade") Integer grade);

    void minusGrade(@Param("id") Long uId, @Param("grade") Integer grade);

    Integer selectGradeById(Long userId);


    List<User> selectGradeTop(QueryObject qo);

    User selectUserByPhoneNumber(String phoneNumber);

    List<Long> selectForFollow(Long userId);

    List<String> selectImgsByIds(List<Integer> users);

    /**
     * 查询用户的所有关注的用户
     * @param ids
     * @return
     */
    List<User> selectForFollows(List<Long> ids);

    List<Long> selectForFuns(Long id);

    /**
     * 查询指定用户感兴趣的人，不能有自己
     * @param userId
     * @return
     */
    List<User> listInteresteds(Long userId);
}